<!--
 * @Author: Islands 1430536748@qq.com
 * @Date: 2024-07-13 01:49:05
 * @LastEditors: 周洋 1430536748@qq.com
 * @LastEditTime: 2024-08-21 13:46:37
 * @version: 1.1.2
 * @Description: 全局页面入口
-->
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { configStore } from '@/plugins/pinia/index.ts';
import useInit from '@/hooks/init/index';
const { Widgets } = storeToRefs(configStore());
const component = (path: any, Component: any, _route: any) => {
    if (path == '/login' || path == '/') {
        return Component;
    }
    return getCurrentInstance()?.appContext.components[Widgets.value.layout];
};

//初始化
useInit().init();
</script>
<template>
    <el-config-provider :locale="Widgets.language.el">
        <router-view #default="{ route, Component }">
            <el-scrollbar height="800px">
                <!-- <transition :enter-active-class="`animate__animated ` + Widgets.anime[0]" appear> -->
                    <div :key="$route.path">
                        <component :is="component(route.fullPath, Component, route)" />
                    </div>
                <!-- </transition> -->
            </el-scrollbar>
        </router-view>
    </el-config-provider>
</template>
